﻿#ifndef _OI_PLSCANNERCORE_LINEVIEW_H_
#define _OI_PLSCANNERCORE_LINEVIEW_H_

#include "PLScannerCore/OiPLScannerCore.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API LineView : public QGraphicsView
        {
            Q_OBJECT
        public:
            LineView(Qt::Orientation orientation = Qt::Horizontal, QWidget* parent = NULL);

        public:
            ~LineView();

       signals:
            void axisHasChanged();

        public slots:
           
            QList<QPointF> profile() const;
            QList<QList<QPointF>> profiles() const;

            void display(const QList<QList<QPointF>>& profiles);
            void display(const QList<QPointF>& profile);

            void setTol(double tol, double eTol = -1.0);

        public slots:
            void invalidate();

        public slots:
            void zoomOut(double factor);
            void zoomFit();

        protected:
            void mousePressEvent(QMouseEvent *event);
            void mouseReleaseEvent(QMouseEvent *event);
            void mouseMoveEvent(QMouseEvent *event);
            void mouseDoubleClickEvent(QMouseEvent *event);
            void wheelEvent(QWheelEvent *event);
            void resizeEvent(QResizeEvent *event);
            void paintEvent(QPaintEvent *event);
            void showEvent(QShowEvent *event);
            void hideEvent(QHideEvent *event);

            void drawBackground(QPainter *painter, const QRectF &rect);


        private:
            OI_DISABLE_COPY(LineView);
            OI_DECLARE_IMPL(LineView);
        };

    }
}

#endif
